package com.wandian.cqcsk.adapter.mine;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.net.Uri;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mylib.libcore.utils.UIUtils;
import com.wandian.cqcsk.R;

import java.io.File;

/**
 * @author Administrator
 * @date 2019/12/16-13:32
 * @description HelpSuggestPicRecycleAdapter
 **/
public class HelpSuggestPicRecycleAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public HelpSuggestPicRecycleAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        ImageView iv_report_copy = helper.getView(R.id.iv_report_copy);
        try {
            if(!UIUtils.isEmpty(item)){
                iv_report_copy.setImageURI(Uri.fromFile(new File(item)));
            }else {
                iv_report_copy.setBackground(mContext.getResources().getDrawable(R.drawable.img_add_pic));
            }
        } catch (Resources.NotFoundException e) {
            iv_report_copy.setBackground(mContext.getResources().getDrawable(R.drawable.img_add_pic));
        }
    }

}
